package cn.arikeky.feign;

import cn.arikeky.domain.User;
import cn.arikeky.dto.BuyDto;
import cn.arikeky.fallback.MoveServiceFallbackFactory;
import cn.arikeky.result.JsonResult;
import io.swagger.models.auth.In;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@FeignClient(contextId="moveService",
        value = "service-move",
        fallbackFactory = MoveServiceFallbackFactory.class,
        path = "/movieTicket")
public interface MoveService {

    @RequestMapping(value = "/list",method = RequestMethod.GET)
    JsonResult list();

    @RequestMapping(value = "/{id}",method = RequestMethod.GET)
    JsonResult get(@PathVariable("id") Long movieId);

    @RequestMapping(value = "/buy/{movieId}/{count}",method = RequestMethod.GET)
    JsonResult buyMovie(@PathVariable("movieId") Long movieId, @PathVariable("count") Integer count);

    @RequestMapping(value="/give{movieId}/{count}/{userId}",method= RequestMethod.POST)
     JsonResult give(@PathVariable("movieId") Long movieId, @PathVariable("count") Integer count, @PathVariable("userId") Long userId);

    @RequestMapping(value = "/use/{id}",method = RequestMethod.GET)
    JsonResult use(@PathVariable("id") Long id);
}